//package com.sky.aop;
//
//import com.sky.annotation.CleanRedis;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Component;
//
//@Aspect
//@Component
//@Slf4j
//public class RedisHandle {
//
//    @Autowired
//    private RedisTemplate redisTemplate;
//
//    @Pointcut("@annotation(com.sky.annotation.CleanRedis)")
//    public void pt() {
//    }
//
//    @Around("pt()")
//    public Object handle(ProceedingJoinPoint pjp) throws Throwable {
//        Object proceed = pjp.proceed();
//
//        MethodSignature signature = (MethodSignature) pjp.getSignature();
//        CleanRedis annotation = signature.getMethod().getAnnotation(CleanRedis.class);
//        log.info("扫描到注解，开始清空redis");
//        redisTemplate.delete(annotation.value());
//        log.info("redis已清空");
//        return proceed;
//    }
//}
